﻿using System;
using System.Collections.Generic;
using System.Text;

namespace sdf.Code
{
	///<summary>
	/// DatabaseColumnAttribute allows for generated class objects to be decorated with source database object info
	///</summary>
	public sealed class DatabaseColumnAttribute : System.Attribute
	{
		//constructor
		public DatabaseColumnAttribute(string sDatabaseObjectName, string sDatabaseObjectType, bool bIsPrimaryKeyValue, bool bIsIdentity, bool bIsForeignKey )
		{
			_sDatabaseObjectName = sDatabaseObjectName;
			_sDatabaseObjectType = sDatabaseObjectType;
			_bIsPrimaryKeyValue = bIsPrimaryKeyValue;
			_bIsIdentity = bIsIdentity;
			_bIsForeignKey = bIsForeignKey;
		}

		//object name
		private string _sDatabaseObjectName;
		public string DatabaseObjectName
		{
			get
			{
				return _sDatabaseObjectName;
			}
		}

		//object type
		private string _sDatabaseObjectType;
		public string DatabaseObjectType
		{
			get
			{
				return _sDatabaseObjectType;
			}
		}

		//is primary key
		private bool _bIsPrimaryKeyValue;
		public bool IsPrimaryKeyValue
		{
			get
			{
				return IsPrimaryKeyValue;
			}
		}

		//is identity
		private bool _bIsIdentity;
		public bool IsIdentity
		{
			get
			{
				return IsIdentity;
			}
		}

		//is foreign key
		private bool _bIsForeignKey;
		public bool IsForeignKey
		{
			get
			{
				return IsForeignKey;
			}
		}
	}
}
